<?php /* Smarty version 2.6.26, created on 2011-02-16 17:21:41
         compiled from admin/submodules/service_add.module.html */ ?>

<script type="text/javascript">
<!--<?php echo '
$(document).ready
(
    function()
    {
	$(\'div.dialog#service\').dialog
	(
	    \'option\',
	    {
		title:	\'Добавить услугу\',
		width:	640,
		resizable:	false,
		buttons:
		{
		    \'Сохранить\':	function(){$(this).find(\'form\').submit();}
		}
	    }
	);

	$(\'a#service-add\').click(function(){$(\'div.dialog#service\').dialog(\'open\');});

	$(\'select#service-name-id\').change
	(
	    function()
	    {
		$(\'.service-options:visible\').hide();

		switch( $(this).val() )
		{
		    case \'3\':
			$(\'.service-options#service-name-3\').show();
			break;
		}
	    }
	);
    }
);
'; ?>
-->
</script>

<!-- Добавление услуги -->
<div class="dialog" id="service">
    <form action="db.php" method="post">
	<input type="hidden" name="action" value="service.new.do"/>
	<input type="hidden" name="account_id" value="<?php echo $this->_tpl_vars['customer']['account_id']; ?>
"/>
	<table class="ui-widget" cellspacing="0" width="100%">
	    <tr>
		<td align="right">Услуга:</td>
		<td>
		    <select name="service_name" id="service-name-id">
		    <?php $_from = $this->_tpl_vars['service_names']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['sn']):
?>
			<option value="<?php echo $this->_tpl_vars['sn']['id']; ?>
"><?php echo $this->_tpl_vars['sn']['service_name']; ?>
</option>
		    <?php endforeach; else: ?>
			<option class="ui-state-disabled" value="">Нет доступных услуг</option>
		    <?php endif; unset($_from); ?>
		    </select>

		    <table class="service-options ui-state-default" id="service-name-3" style="display:none;">
			<tr>
			    <td align="right"><strong>Номер телефона:</strong></td>
			    <td><input type="text" name="phone_number"/></td>
			</tr>
			<tr>
			    <td align="right"><strong>Тариф:</strong></td>
			    <td>
				<select name="phone_rate_id">
				<?php $_from = $this->_tpl_vars['phone_rates']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['rate']):
?>
				    <option value="<?php echo $this->_tpl_vars['rate']['id']; ?>
"><?php echo $this->_tpl_vars['rate']['rate_name']; ?>
</option>
				<?php endforeach; endif; unset($_from); ?>
				</select>
			    </td>
			</tr>
		    </table>
		</td>
	    </tr>
	    <tr>
		<td align="right">Исполнитель:</td>
		<td>
		    <select name="executive">
		    <?php $_from = $this->_tpl_vars['executives']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['executive']):
?>
			<option value="<?php echo $this->_tpl_vars['executive']['id']; ?>
"><?php echo $this->_tpl_vars['executive']['executive_name']; ?>
</option>
		    <?php endforeach; else: ?>
			<option class="ui-state-disabled" value="">Нет доступных исполнителей</option>
		    <?php endif; unset($_from); ?>
		    </select>
		</td>
	    </tr>
	    <tr>
		<td align="right">Стоимость:</td>
		<td><input type="text" name="cost" value="0.00"/></td>
	    </tr>
	    <tr>
		<td align="right">Ежемесячная:</td>
		<td><input type="checkbox" name="monthly"/></td>
	    </tr>
	    <tr>
		<td align="right">Начало:</td>
		<td><input type="text" name="start_date" class="date"/></td>
	    </tr>
	    <tr>
		<td align="right">Конец:</td>
		<td><input type="text" name="stop_date" class="date"/></td>
	    </tr>
	</table>
    </form>
</div>